fix wormhole --appid option position
authorJoey Hess <joeyh@joeyh.name>
Mon, 26 Sep 2022 19:11:38 +0000 (15:11 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 26 Sep 2022 19:11:38 +0000 (15:11 -0400)
p2p: Pass wormhole the --appid option before the receive/send command, as
it does not accept that option after the command

I'm left wondering, did I get this wrong from the beginning, or did
wormhole change its option parser? I'm reminded of the change in 0.8.2
where it silently changed what FD the pairing code was output to.
But, looking at the wormhole source, it was at least putting --appid before
send in its test suite from the introduction of the option.

So I think probably this has always been broken. On 2021-12-31 the --appid
option was enabled, and it took until now for someone to try
git-annex p2p --pair and notice that flag day broke it..

Sponsored-by: Svenne Krap on Patreon
CHANGELOG
Utility/MagicWormhole.hs
doc/bugs/git_annex_connecting_over_tor_does_not_work.mdwn

index 7f2a6773f35cdc532ef95b5f18cd1458d9ff58a6..9a202ccaf60c9bb1dc9b5d2df849bfd623ece78c 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -41,6 +41,8 @@ git-annex (10.20220823) UNRELEASED; urgency=medium
   * enable-tor: Fix breakage caused by git's fix for CVE-2022-24765.
   * Let GIT_DIR and --git-dir override git's protection against operating
     in a repository owned by another user.
+  * p2p: Pass wormhole the --appid option before the receive/send command,
+    as it does not accept that option after the command
 
  -- Joey Hess <id@joeyh.name>  Mon, 29 Aug 2022 15:03:04 -0400
 
index cc189b62523fae013fba8576128380aa871f3fb0..a4128d1d5c0329ef2dcae6759e7e7cc143359905 100644 (file)
@@ -119,7 +119,7 @@ sendFile f (CodeObserver observer) ps = do
                        (findcode ph herr)
                return (inout || inerr)
   where
-       p = wormHoleProcess (Param "send" : ps ++ [File f])
+       p = wormHoleProcess (ps ++ [Param "send", File f])
        findcode ph h = findcode' =<< getwords ph h []
        findcode' [] = return False
        findcode' (w:ws) = case mkCode w of
@@ -140,12 +140,12 @@ receiveFile f (CodeProducer producer) ps = runWormHoleProcess p $ \hin _hout _he
        hFlush hin
        return True
   where
-       p = wormHoleProcess $
+       p = wormHoleProcess $ ps ++
                [ Param "receive"
                , Param "--accept-file"
                , Param "--output-file"
                , File f
-               ] ++ ps
+               ]
 
 wormHoleProcess :: WormHoleParams -> CreateProcess
 wormHoleProcess = proc "wormhole" . toCommand
index bdf2701c249cc3821f7af487616ae2917c526368..586650e5dea5f47de2c176942579cd362560e635 100644 (file)
@@ -78,3 +78,5 @@ p2p: 1 failed
 ### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
 
 git annex has been awesome so far in helping track and backup my data, also for allowing me to output podcasts/audiobooks to a small mp3 player, as well as ebooks and pdfs to a kindle paper ewhite, which has made using my ereader no longer an inconvinient endeavour 
+
+> [[fixed|done]] --[[Joey]]